package org.example.quartz.service;

import org.example.quartz.mode.TimingModel;
import org.quartz.SchedulerException;

import java.lang.reflect.InvocationTargetException;

public interface QuartzTaskService {

    /**
     * 添加定时任务
     * @param timingModel
     * @throws NoSuchMethodException
     * @throws IllegalAccessException
     * @throws InvocationTargetException
     * @throws InstantiationException
     * @throws SchedulerException
     */
    void addTask(TimingModel timingModel) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, SchedulerException;

    /**
     * 修改定时任务
     * @param timingModel
     * @throws SchedulerException
     */
    void updateTask(TimingModel timingModel) throws SchedulerException;

    /**
     * 暂停定时任务
     * @param taskName
     * @param groupName
     * @throws SchedulerException
     */
    void pauseTask(String taskName, String groupName) throws SchedulerException;

    /**
     * 恢复定时任务
     * @param taskName
     * @param groupName
     * @throws SchedulerException
     */
    void resumeTask(String taskName, String groupName) throws SchedulerException;

    /**
     * 删除定时任务
     * @param taskName
     * @param groupName
     * @throws SchedulerException
     */
    void deleteTask(String taskName, String groupName) throws SchedulerException;

    /**
     * 启动所有任务
     */
    void startAllTasks();

    /**
     * 关闭定时任务
     */
    void shutdownAllTasks();


    /**
     * 添加日志-插入log日志
     * @param
     * @throws
     */
    int loginfo(String methodName,String ts,String state,String inJson,String outJson,String dateid,String yyid,String gsUrl,String TS);

    /**
     * 添加组织
     * @param
     * @throws
     */
    int insertOrg(String orgName, String orgCode);


    /**
     * 根据用友code转换成浪潮GSCode
     *
     * */
    String selectGsCode(String orgCode);



}
